function MyForm() {
    const handleBoxChange = (e) => {
        // 重点是 e.target这个属性
        console.log(e)
        console.log('复选框状态改变了')
    }
    const handleInputChange = (e) => {
        console.log(e)
        console.log('文本输入框状态改变了')
    }
    const handleSubmit = (e) => {
        // 阻止默认行为
        e.preventDefault();
        console.log('提交了')
    }
    return <>
        <form onSubmit={handleSubmit}>
            <input type="checkbox" onChange={handleBoxChange} />
            <input type="text" placeholder onChange={handleInputChange} />
            <button type="submit">提交</button>
        </form>
    </>
}

export default MyForm;